import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 分页列表
export function list (data) {
    return request({
        url: '/school/student/studentPage',
        method: 'post',
        data
    })
}

// 详情
export function getById (query) {
    return request({
        url: '/school/student/getById/' + query.id,
        method: 'get',
        params: query
    })
}

// 新增
export function add (data) {
    return request({
        url: '/school/student/add',
        method: 'post',
        data: data
    })
}

// 修改
export function edit (data) {
    return request({
        url: '/school/student/edit',
        method: 'put',
        data: data
    })
}

// 删除
export function deleteById (data) {
    return request({
        url: '/school/student/deleteById/' + data.id,
        method: 'delete',
        data
    })
}

// 重置密码
export function resetPwd (params) {
    return request({
        url: '/school/student/resetPwd',
        method: 'put',
        params
    })
}

// 冻结/解冻
export function setStatus (data) {
    return request({
        url: '/school/student/setStatus/' + data.id,
        method: 'put',
        data
    })
}

// 批量解冻
export function setStatusByIds (data) {
    return request({
        url: '/school/student/setStatusByIds/' + data.id,
        method: 'put',
        data
    })
}

// 分页获取学生列表V2--布置作业用
export function studentPageV2 (data) {
    return request({
        url: '/school/student/studentPageV2',
        method: 'post',
        data
    })
}